package edu.spec.lyq.week09.class2.home.work1;

import java.util.ArrayList;
import java.util.List;

/**
 * \* User: 11028
 * \* Date: 2018/10/27
 * \* Time: 14:55
 * \* Description:6、建立测试类Test
 * 在Test里建立main方法，在main方法里
 * 构造一个主人对象tom，tom养了2条猫，4条狗。请分别给这些动物起名字，定义他们喜欢吃的食物。
 */
public class Test {
    public static void main(String[] args) {
        List sounds = new ArrayList();
        sounds.add("瞄");
        sounds.add("敖");
        List foods = new ArrayList();
        foods.add(new Food("鱼", 10));
        foods.add(new Food("米饭", 3));
        Mater tom = new Mater();

        Animal cat1 = new Cat("猫1",sounds,foods);
        Animal cat2 = new Cat("猫2",sounds,foods);

        Animal dog1 = new Dog("狗1",sounds,foods);
        Animal dog2 = new Dog("狗2",sounds,foods);
        Animal dog3 = new Dog("狗3",sounds,foods);
        Animal dog4 = new Dog("狗4",sounds,foods);
        tom.pets = new ArrayList();
        tom.pets.add(cat1);
        tom.pets.add(cat2);
        tom.pets.add(dog1);
        tom.pets.add(dog2);
        tom.pets.add(dog3);
        tom.pets.add(dog4);
        tom.feed(cat1);
        tom.feed(cat2);
        tom.feed(dog1);
        tom.feed(dog2);
        tom.feed(dog3);
        tom.feed(dog4);




    }
}
